﻿using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IndoorPosition.Server.Core.Entities
{
    /// <summary>
    /// 建筑
    /// </summary>
    [Comment("建筑")]
    public class Building : EntityBase
    {
        /// <summary>
        /// 建筑物名称
        /// </summary>
        [Comment("建筑物名称")]
        [StringLength(50)]
        public string Name
        {
            get;
            set;
        }

        /// <summary>
        /// 模型参照点X坐标
        /// </summary>
        [Comment("模型参照点X坐标")]
        public double X0
        {
            get;
            set;
        }

        /// <summary>
        /// 模型参照点Y坐标
        /// </summary>
        [Comment("模型参照点Y坐标")]
        public double Y0
        {
            get;
            set;
        }


        /// <summary>
        /// 模型坐标X0对应的WGS84墨卡托投影坐标
        /// </summary>
        [Comment("模型坐标X0对应的WGS84墨卡托投影坐标")]
        public double X
        {
            get;
            set;
        }

        /// <summary>
        /// 模型坐标Y0对应的WGS84墨卡托投影坐标
        /// </summary>
        [Comment("模型坐标Y0对应的WGS84墨卡托投影坐标")]
        public double Y
        {
            get;
            set;
        }

        /// <summary>
        /// 建筑物高程
        /// </summary>
        [Comment("建筑物高程")]
        public double Height
        {
            get;
            set;
        }

        /// <summary>
        /// 模型
        /// </summary>
        [Comment("模型")]
        [StringLength(50)]
        public string Model
        {
            get;
            set;
        }

        /// <summary>
        /// 项目ID
        /// </summary>
        [Comment("项目ID")]
        public int ProjectId
        {
            get;
            set;
        }

        /// <summary>
        /// 所属项目
        /// </summary>
        [ForeignKey("ProjectId")]
        public virtual Project Project
        {
            get;
            set;
        }

        /// <summary>
        /// 楼层
        /// </summary>
        public virtual ICollection<Floor> Floors
        {
            get;
            set;
        }
    }
}
